﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class EnterNodeHandler : BaseNodeHandler
{
    public override BehaviorNodeState ExcuteNode(BehaviorEntity entity, NodeData node)
    {
        SingleBranchNodeData data = (SingleBranchNodeData)node;
        if (data.CurNodeState == BehaviorNodeState.Running)
        {
            data.CurNodeState= GetChildNodeHandler(data.ChildNode.CurNodeType).ExcuteNode(entity, data.ChildNode);
        }
        return node.CurNodeState;
    }

    public override void ResetNode(NodeData node)
    {
        SingleBranchNodeData data = (SingleBranchNodeData)node;
        data.CurNodeState = BehaviorNodeState.Running;
    }
}
